Skip to content

async: a vectored write the caller can await (into stable) - #25

Merged
EdmondDantes merged 3 commits into
true-async-stablefrom
true-async
Aug 20, 2026
Merged

async: a vectored write the caller can await (into stable)#25
EdmondDantes merged 3 commits into
true-async-stablefrom
true-async

Conversation

@EdmondDantes

Copy link
Copy Markdown

Carries the three commits of #24 from true-async into true-async-stable: the ZEND_ASYNC_IO_WRITEV_AWAIT flag, the mode mask beside it, and the ZEND_ASYNC_IO_WRITEV_AWAITED macro.

Header only, and additive — the flag word already existed, so no signature changes and the two existing mode values keep their meaning.

Reactor half: true-async/php-async#262. Consumer: true-async/server#186, where a cancelled HTTP/1 handler frees a frame libuv still points at, because the only write that reports its status is also the only one that leaves the buffer with the caller.

EdmondDantes and others added 3 commits August 20, 2026 15:41
The vectored write is fire-and-forget in both of its modes: the completion
sends no notification and the release callback carries no status. A caller
that needs the outcome therefore has to use the single-buffer write, which
does not take the buffer over — so it must free it itself, and the only
moment it can is when its own wait ends. Those are different moments once
the waiting coroutine is cancelled: the wait is over and the write is not.

ZEND_ASYNC_IO_WRITEV_AWAIT says the caller waits. Ownership stays the mode's;
the completion keeps the request alive and notifies io->event with the request
as the result and no exception, so a caller matching by request pointer wakes
and no sibling awaiter on the same handle does.

Header only: the flag word already existed, so no signature changes and the
existing values keep their meaning.
async: a vectored write the caller can await
@EdmondDantes
EdmondDantes merged commit c0c0782 into true-async-stable Aug 20, 2026
9 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant